<?
require("config.php");

$location_status .= "| Add";
$show_backnav = "user_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

  if (checkUsername($table,$Username)){

	header("location:" . $rela_path . "share/msg.php?v=9005");

	exit();
  
  }
   $field = array(
	"code", 
	"username", 
	"password", 
	"name",
	"tel",
    "fax",
	"email",
	"alert01",
	"alert02",
	"alert03",
	"alert04",
	"alert05",
	"type",
	);


   $content = array(
	$Code, 
	$Username, 
	$Password, 
	$Name,
	$Tel,
	$Fax,
	$Email,
	$Alert01,
	$Alert02,
	$Alert03,
	$Alert04,
	$Alert05,
	$Type,
	);

   myInsert($table,$field,$content);


   header("location:" . $rela_path . "share/msg.php?v=53");

   exit();

}else{

  if (checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9001");

	exit();
  
  }

}

require($rela_path . "inc/header.php");

?>



<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="add">
<input name="Code" type="hidden" value="<?print($Code)?>">




<table width="95%" border="0" align="center">
  <tr> 
    <td valign="top"> 
      <div align="right"><br>
      </div>
      <table border="0" cellspacing="0" cellpadding="2">
        <tr> 
          <td width="137" class="tdheader">Code :</td>
          <td width="455"><?print($Code)?>
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Status :</td>
          <td width="455">
<?
if ($admin_type<9) {
	print("Operator");
	print("<input name=\"Type\" type=\"hidden\" value=\"0\">");
}else{
	print(selectType($Type));
}
?>
		  </td>
        </tr>

        <tr> 
          <td width="137" class="tdheader">Username :</td>
          <td width="455"> 
            <input type="text" class="text" name="Username">
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Password :</td>
          <td width="455"> 
            <input type="text" class="text" name="Password">
          </td>
        </tr>
        <tr> 
          <td width="137" height="3" class="tdheader">Name</td>
          <td width="455" height="3"> 
            <input type="text" class="text" name="Name" size="40" value="">
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Tel :</td>
          <td width="455"> 
            <input type="text" class="text" name="Tel" value="" size="40">
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Fax :</td>
          <td width="455"> 
            <input type="text" class="text" name="Fax" value="" size="40">
          </td>
        </tr>
        <tr> 
          <td width="137" class="tdheader">Email :</td>
          <td width="455"> 
            <input type="text" class="text" name="Email" size="40" value="">
          </td>
        </tr>
        <tr>
          <td width="137" class="tdheader">Receive Alert Email</td>
          <td width="455"> 
            <input type="checkbox" name="Alert01" value="y">
           
            Customer Order<br>
            <input type="checkbox" name="Alert02" value="y">
            Re-order Alert <br>
            <input type="checkbox" name="Alert03" value="y">
            Out of stock Alert<br>
            <input type="checkbox" name="Alert04" value="y">
            Customer Registration<br>
            <input type="checkbox" name="Alert05" value="y">
            Newsletter Subscription</td>
        </tr>
        <tr> 
          <td width="137">&nbsp;</td>
          <td width="455"> <input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('user_menu.php',1);return false;"> <input type="image" src="../../images/bt_save.gif">
          </td>
        </tr>
      </table>
    </td>

  </tr>
</table>
<br>
<br>
<br>
</form>
<?
require($rela_path . "inc/footer.php");
?>
